1. Field of the Invention
The present invention relates to a data compression device and an image reading device.
2. Description of the Related Art
Image reading devices such as facsimile machines, image scanners, copying machines, and so on include a data compression device that generates encoded data by compressing the image data to a specific compression ratio. Also, the compression ratio of the image data varies depending on the content of the image data, so without compressing the data it is not possible to know the size of the data after compression.
Image processing devices that include this type of data compression device include a plurality of compressed page memories (hereafter referred to as page memory) (see Japanese Patent Application Publication No. 2000-261630). This type of image processing device is constituted so that the status of use of the plurality of page memories varies dynamically in accordance with the length of the encoded data.
This type of image processing device compares the data length of the encoded data obtained from compressing the image data with the empty capacity in the plurality of page memories. Then, if the data length of the encoded data is not larger than the amount of a single empty page memory, the image processing device stores the encoded data in a single page memory. On the other hand, if the data length is larger than the amount of a single page memory, the image processing device stores it in a plurality of page memories.
This type of image processing device stores as shown in FIG. 5 a plurality of bands of encoded data, for example the encoded data (1) to (14), in a continuous address of a page memory 100. The meaning of “band” is explained later. In this case the following problem arises.
In other words, when each specific band of the image data is compressed, the data length of each band of compressed encoded data varies in accordance with the data content of the image data. Therefore, the starting addresses at which that the encoded data (1) to (14) after compression should be stored in the page memory 100 can only be defined after storing the previous encoded data (1) to (14) in the page memory 100. On the other hand, execution of the compression processing by the encoding unit cannot be started if the encoding unit (or memory control unit) does not know the starting address in the page memory 100 of the data after compression. Therefore, when compression processing of one band is finished, and the starting address of the next band is defined, it is necessary to carry out encoding setting in which the starting address is set in the encoding unit (or memory control unit).
In this case time is necessary for encoding setting after completion of execution of compression processing of a certain band until the start of compression processing of the next band, and this has the problem that the compression time of image processing is increased.